package io.chenglicun.modules.clcHousePersonInfo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.chenglicun.common.service.impl.CrudServiceImpl;
import io.chenglicun.common.constant.Constant;
import io.chenglicun.modules.clcHousePersonInfo.dao.ClcHousePersonInfoDao;
import io.chenglicun.modules.clcHousePersonInfo.dto.ClcHousePersonInfoDTO;
import io.chenglicun.modules.clcHousePersonInfo.entity.ClcHousePersonInfoEntity;
import io.chenglicun.modules.clcHousePersonInfo.service.ClcHousePersonInfoService;
import io.chenglicun.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 房屋居住人信息
 *
 * @author HB 137664951@qq.com
 * @since 1.0 2024-01-22
 */
@Service
public class ClcHousePersonInfoServiceImpl extends CrudServiceImpl<ClcHousePersonInfoDao, ClcHousePersonInfoEntity, ClcHousePersonInfoDTO> implements ClcHousePersonInfoService {

    @Override
    public QueryWrapper<ClcHousePersonInfoEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<ClcHousePersonInfoEntity> wrapper = new QueryWrapper<>();

        if(null != params.get("houseId") && !"".equals(params.get("houseId").toString())) {
            wrapper.lambda().eq(ClcHousePersonInfoEntity::getHouseId, params.get("houseId"));
        }
        if(null != params.get("houseNum") && !"".equals(params.get("houseNum").toString())) {
            wrapper.lambda().eq(ClcHousePersonInfoEntity::getHouseNum, params.get("houseNum"));
        }
        return wrapper;
    }


}